﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Q.Cms.Controllers
{
    public class HomeController : Controller
    {
        //
        // GET: /Home/
        //[StaticFileWriteFilter]
        [OutputCache(CacheProfile="index")]
        public ActionResult Index()
        {
            return View();
        }

        public ActionResult Login()
        {
            //if (Request.Cookies["t"] == null || string.IsNullOrEmpty(Request.Cookies["t"].Value))
            //{
            //    Response.Cookies.Add(new HttpCookie("t", DateTime.Now.Ticks.ToString()));
            //}
            return View();
        }

        [HttpPost]
        public ActionResult Login(string name)
        {
            Session["u"] = name;
            Response.Cookies.Add(new HttpCookie("t", DateTime.Now.Ticks.ToString()));
            return View();
        }

    }
}
